home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / VISCAFE.BIN / VPOJAVA.DLL / SOURCE / DIALOG < prev    next >
Encoding:
Text File  |  1997-06-19  |  965 b   |  46 lines

  1. /*
  2.     A basic extension of the java.awt.Dialog class
  3.  */
  4.  
  5. import java.awt.*;
  6.  
  7. public class Dialog1 extends Dialog {
  8.  
  9.     public Dialog1(Frame parent, boolean modal) {
  10.  
  11.         super(parent, modal);
  12.  
  13.         //{{INIT_CONTROLS
  14.         setLayout(null);
  15.         addNotify();
  16.         resize(insets().left + insets().right + 430,insets().top + insets().bottom + 270);
  17.         //}}
  18.     }
  19.  
  20.     public Dialog1(Frame parent, String title, boolean modal) {
  21.         this(parent, modal);
  22.         setTitle(title);
  23.     }
  24.  
  25.     public synchronized void show() {
  26.         Rectangle bounds = getParent().bounds();
  27.         Rectangle abounds = bounds();
  28.  
  29.         move(bounds.x + (bounds.width - abounds.width)/ 2,
  30.              bounds.y + (bounds.height - abounds.height)/2);
  31.  
  32.         super.show();
  33.     }
  34.  
  35.     public boolean handleEvent(Event event) {
  36.         if(event.id == Event.WINDOW_DESTROY) {
  37.             hide();
  38.             return true;
  39.         }
  40.         return super.handleEvent(event);
  41.     }
  42.  
  43.     //{{DECLARE_CONTROLS
  44.     //}}
  45. }
  46.